package xml;
import java.util.List;

import org.jdom.Document;

import org.jdom.Element;

import org.jdom.input.SAXBuilder;

import uteis.Constantes;

 

public class LeXML {

	 public static void ler(){

    //  public static void main(String[] args) {

            Document doc = null;

            SAXBuilder builder = new SAXBuilder();

            try {
                  doc = builder.build("./conexao.xml");
            } catch (Exception e) {
                  e.printStackTrace();
            }           

            Element banco = doc.getRootElement();

            List<Element> lista = banco.getChildren();

            for (Element e: lista ){

//                  System.out.println("base: "+ e.getChildText("base"));
//                  System.out.println("local: " + e.getChildText("local"));
//                  System.out.println("user: " + e.getChildText("user"));
//                  System.out.println("senha: " + e.getChildText("senha"));
                  
                  Constantes.base=e.getChildText("base");
                  Constantes.local=e.getChildText("local"); 
                  Constantes.user=e.getChildText("user"); 
                  Constantes.senha=e.getChildText("senha");
            }           

      }

 }